# import *


def open_file():
    # 班级名单
    a = [0]
    with open("D:\Code\Python\Pycharm\查重\_className_", "r", encoding="utf-8") as fi:
        for x in fi:
            x = x.strip()
        #    print(x)
            a.append(x)
    a.pop(0)
    #print(a)
    return a


def than():
    a = [0]
    b = [0]
    with open("D:\Code\Python\Pycharm\查重\zhuxuejin.txt", "r", encoding="gbk") as fi:
        for x in fi:
            x.strip()
            #    print(x)
            type(x)
            a.append(x)
        a.pop(0)

    for i in a:
    #    print(i)
        i = i.strip("\n")
        i = i.split("，")
     #   print(type(i))
        for y in i:
            b.append(y)
    b.pop(0)
    #print(b)
    return b

for x in than():
    for y in open_file():
        if x == y:
            print(y)

